library(plotly)
library(tidyverse)
library(kableExtra)
library(DT)

load('data/covid_today.RData')
load('data/geojson.RData')

Map of New Deaths

fig <-
  today_counties %>%
  filter(new_cases > 0) %>%
  mutate(cty_name = paste(county, 'County -', state)) %>%
  plot_ly(data = .) %>%
  add_trace(
    type="choroplethmapbox",
    geojson=geo_counties,
    locations=~fips,
    z=~new_deaths,
    colorscale="YlOrRd",
    reversescale=T,
    text=~cty_name,
    hoverinfo='z+text',
    marker=list(line=list(
      width=0),
      opacity=0.5
    )
  ) %>%
  layout(
    mapbox=list(
      style="carto-positron",
      zoom =2,
      center=list(lon= -95.71, lat=37.09))
  )
fig